<!-- App.vue -->
<template>
  <router-view />
</template>

<script setup lang="ts">
// 设置根元素字体大小
function setRem() {
  const docEl = document.documentElement;
  const resizeEvt = "orientationchange" in window ? "orientationchange" : "resize";
  const recalc = () => {
    const clientWidth = docEl.clientWidth;
    if (!clientWidth) return;
    // 以375px设计稿为例，1rem = 20px
    docEl.style.fontSize = 20 * (clientWidth / 375) + "px";
  };
  window.addEventListener(resizeEvt, recalc, false);
  document.addEventListener("DOMContentLoaded", recalc, false);
}

setRem();
// 确保没有在这里执行登录状态判断
</script>
<style lang="less">
* {
  padding: 0;
  margin: 0;
}
</style>
